<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div class="box">box1</div>
    <div class="box">box2</div>
    <div class="box">box3</div>
    <div class="wrapper"></div>
    <div class="box1">class获取DOM</div>
    <div id="box2">id获取DOM</div>
    <div>标签获取DOM</div>
  </body>
  <script src="./jquery.js"></script>
  <script src="./myframework.js"></script>
  <script>
    // console.dir(window);
    // myFramework();
    // my();
    // console.log(my().init("<div style='color:red;'>box</div>"));
    // $(".wrapper").append(my().init("<div style='color:red;'>box</div>"));
    // my().init(".box1")[0].innerHTML = "red";
    // my().init("#box2")[0].style.color = "aqua";
    // my().init("div")[3].style.fontSize = "20px";

    // my("div")[2].style.color="red"

    // 获取所有class为box的DOM
    console.log(my(".box"));
    // 获取class为box的第一个元素
    console.log(my(".box").first());
    console.log(my(".box").last().innerHTML);
    my(".box").get(1).style.cssText = "color:red;font-size:30px";

    console.log(my());
    my("#box2").click(function () {
      alert("这是click事件");
    });
  </script>
</html>
